package com.iexbuy.ihg.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;

import com.iexbuy.ihg.R;
import com.iexbuy.ihg.common.CommUtil;
import com.iexbuy.ihg.entity.LingQianSuccessObject;
import com.iexbuy.ihg.entity.YunDealObject;
import com.iexbuy.ihg.entity.YunItemListObject;
import com.jingchen.pulltorefresh.PullToRefreshLayout;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;

import org.w3c.dom.Text;

public class MianDanResultFragment extends BaseFragment {
	
	private static MianDanResultFragment homeFragmentInstent;

	private static LingQianSuccessObject lingQianSuccessObject;

	@ViewInject(R.id.currentProfile)
	private TextView currentProfile;
	@ViewInject(R.id.coinBalance)
	private TextView coinBalance;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		homeFragmentInstent = this;
	}

	@Override
	protected View _onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_miandan_order_result, container, false);
		ViewUtils.inject(this, rootView);
		initView(rootView);
		return rootView;
	}

	private void initView(View rootView) {
		mBaseActivity.setTitle(getResources().getString(R.string.mian_dan_result));
		mBaseActivity.setTitleLayoutVisibility(true);
		mBaseActivity.setHomeActivity(false);

		currentProfile.setText(lingQianSuccessObject.getWaitingPosition());
		coinBalance.setText("您的金币余额：" + lingQianSuccessObject.getCoinRemainingNumber());
	}

	@OnClick(R.id.continueYunguoBtn)
	public void onContinueYunguoBtnClick() {
		mBaseActivity.finish();
	}

	public static void setLingQianSuccessObject(LingQianSuccessObject lingQianSuccessObject) {
		MianDanResultFragment.lingQianSuccessObject = lingQianSuccessObject;
	}

	/**
	 * @return the homeFragmentInstent
	 */
	public static MianDanResultFragment getHomeFragmentInstent() {
		return homeFragmentInstent;
	}

}
